# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-ovos-bus-client
pkgver=0.1.1
pkgrel=0
pkgdesc="A simple interface for the mycroft messagebus and can be used to connect to ovos"
url="https://github.com/OpenVoiceOS/ovos-bus-client"
arch="noarch"
license="Apache-2.0"
depends="
	py3-orjson
	py3-ovos-config
	py3-ovos-utils
	py3-pyee
	py3-websocket-client
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/OpenVoiceOS/ovos-bus-client/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/ovos-bus-client-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	# Disabled tests have broken imports
	.testenv/bin/python3 -m pytest  -k 'not test_class_patching and not test_inheritance and not test_create_client' \
		--ignore test/unittests/test_compat.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
5bb564a6a442eb43350b9b58a5c81bb045f65f0388d3ac4ddb48746c80f8b9917e6616a8c48c81133cc08acc9c17b6debbb461336642a2f4c9497294a2e11d5d  py3-ovos-bus-client-0.1.1.tar.gz
"
